package com.life.muyu.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author zyb
 * @Date 2020/2/12 18:58
 **/
@Configuration
public class StaticResourceConfig implements WebMvcConfigurer {

    @Value("${visual.home.img}")
    private String imgPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**")
                .addResourceLocations("file:"+imgPath);
//        registry.addResourceHandler("/video/**")
//                .addResourceLocations("file:D:/gameStatic/video/");
    }
}
